def send_email(msg_to,send_info):
    import smtplib
    from email.mime.text import MIMEText
    from email.header import Header
    msg_from = '1531472317@qq.com'  # 发送方邮箱
    passwd = 'whoupizggkfchaif'  # (填入发送方邮箱的授权码(填入自己的授权码，相当于邮箱密码)
    msg_to = '1531472317@qq.com'
    # msg_to = ['','','']
    subject = "欢迎您注册登录账户"  # 主题
    content = '您的注册账户的验证码是123456'
    # 生成一个MIMEText对象（还有一些其它参数）
    msg = MIMEText(content)
    # 放入邮件主题import smtplib
    # 放入邮件主题
    msg['Subject'] = subject
    # 也可以这样传参
    # msg['Subject'] = Header(subject, 'utf-8')
    # 放入发件人
    msg['From'] = msg_from
    # 放入收件人
    # 通过ssl方式发送，服务器地址，端口
    s = smtplib.SMTP_SSL("smtp.qq.com", 465)
    # 登录到邮箱
    s.login(msg_from, passwd)
    # 发送邮件：发送方，收件方，要发送的消息
    s.sendmail(msg_from, msg_to, msg.as_string())
    print('成功')
print(send_email('1531472317@qq.com','您的注册账户的验证码是123456'))
def zhuce():
    while True:
        name=input('请输入您的姓名：')
        pwd=input('请输入您的密码：')
        email=input('请输入您的邮箱：')
        infos = f"{name},{pwd},{email}\n"
        f = open('E:\\projects\\PycharmProjects\\bigdata33\\data\\zuoye\\users.csv', mode='a', encoding='UTF-8')
        f.write(infos)
        f.flush()
        f.close()
        print(send_email('1531472317@qq.com','您的注册账户的验证码是123456'))
print(zhuce())
def denglu():
    name = input('请输入您的姓名：')
    pwd = input('请输入您的密码：')
    f = open('E:\\projects\\PycharmProjects\\bigdata33\\data\\zuoye\\users.csv',mode='r', encoding='GBK')
    res1 = f.readlines()
    for i in res1:
        if i==name:
            print('此用户存在')
        else:
            print('此用户不存在')

